#ifndef _FILELIST_INCLUDED_
#define _FILELIST_INCLUDED_

#include "qt-proxy.hh"

struct Device;
class FS;
class FileList:public QAbstractTableModel
{
	Q_OBJECT
	
	QString path;
	QStringList files;
	FS *fs;

	enum Fields{
		name,
		size,
		blocks,
		ctime,
		mtime,
		dtime,
		Max,
	};
	
public:
	int columnCount(const QModelIndex &)const
	{
		return Max;
	};
	int rowCount(const QModelIndex &) const;
	QVariant data(const QModelIndex &, int) const;
	QVariant headerData(int, Qt::Orientation,int) const;
	FileList(FS*);

public slots:
	void setPath(const QModelIndex& index);

private:
	QString getFilePath(const QModelIndex& index) const;
};

#endif //_FILELIST_INCLUDED_
